package com.tuyue.police.controller.vip;

import com.tuyue.police.biz.IUserBiz;
import com.tuyue.police.enums.ResultEnum;
import com.tuyue.police.exception.MyException;
import com.tuyue.police.util.Result;
import com.tuyue.police.util.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 王金海
 * @Description:
 * @Date: Created by Administrator on 2018/4/28.
 * @Modified By:
 */
@RestController
@RequestMapping("vip/user")
public class UserController
{
    @Autowired
    private IUserBiz userBiz;
    @GetMapping("getUser/{tel}")
    public Result getUser(@PathVariable String tel){
        if (tel==null) {
            throw new MyException(ResultEnum.SMS_TELNOTNULL);
        }
       return ResultUtil.success(userBiz.findByPhome(tel));
    }
}
